![]() |
YieldToAnyThread |
||||
Header: | Threads.h | Carbon status: | Supported | |
Relinquishes the current thread’s control.
OSErr YieldToAnyThread ();
A result code.
The YieldToAnyThread function invokes the Thread Manager’s scheduling mechanism. The current thread relinquishes control and the Thread Manager schedules the next available thread.
The current thread is suspended in the ready state and awaits rescheduling when the CPU is available. When the suspended thread is scheduled again, YieldToAnyThread regains control and returns to the function that called it.
If you have installed a custom scheduler, the Thread Manager passes it the thread ID of the suspended thread.
In each thread you must make one or more strategically placed calls to relinquish control to another thread. You can either make this yield call or another yield call such as YieldToThread; or you can make a call such as SetThreadState to explicitly change the state of the thread.
Threads must yield in the CPU addressing mode (24-bit or 32-bit) in which the application was launched.
To relinquish control to a specific thread, use the YieldToThread function.
To change the state of a specified thread, use the SetThreadState function.
Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)